/*
 * @Author: your name
 * @Date: 2020-11-20 10:45:33
 * @LastEditTime: 2020-11-20 10:45:45
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \go-admin-ui\src\api\edu\platform\dept.js
 */
import request from "@/utils/request";

export function getDeptList(query) {
    return request({
        url: "/api/v1/edu/deptList",
        method: "get",
        params: query
    });
}

// 查询部门详细
export function getDept(deptId) {
    return request({
        url: "/api/v1/edu/dept/" + deptId,
        method: "get"
    });
}

// 查询部门下拉树结构
export function treeselect() {
    return request({
        url: "/api/v1/edu/deptTree",
        method: "get"
    });
}

// 根据角色ID查询部门树结构
export function roleDeptTreeselect(roleId) {
    return request({
        url: "/api/v1/edu/roleDeptTreeselect/" + roleId,
        method: "get"
    });
}

// 新增部门
export function addDept(data) {
    return request({
        url: "/api/v1/edu/dept",
        method: "post",
        data: data
    });
}

// 修改部门
export function updateDept(data) {
    return request({
        url: "/api/v1/edu/dept",
        method: "put",
        data: data
    });
}

// 删除部门
export function delDept(deptId) {
    return request({
        url: "/api/v1/edu/dept/" + deptId,
        method: "delete"
    });
}
